const { sequelize, DataTypes } = require('../utill/getSequelize')

//五表联合
const T_user_and_a_c_s = sequelize.define('T_user_and_a_c_s', {

  id: {
    type: DataTypes.INTEGER,
    primaryKey: true,
    autoIncrement: true,
  },


  //外键
  user_id: {
    type: DataTypes.INTEGER,
  },

  academy_id: {
    type: DataTypes.INTEGER,
  },

  class_id: {
    type: DataTypes.INTEGER,
  },

  subject_id: {
    type: DataTypes.INTEGER,
  },

  grade_id:{
    type: DataTypes.INTEGER,
  },

});




//同步模型和数据库表
(async () => {
  try {
    await sequelize.sync({ force: false });
    console.log('All models were synchronized successfully.');
  } catch (error) {
    console.log(error);
  }

})();

//提供出去
module.exports = { T_user_and_a_c_s };